1. Field of the Invention
The present invention relates to efficient management of a data compression/decompression system employed in an image forming apparatus such as a printer.
2. Description of the Related Art
Usually, a printer receives print data (including control data and image data) from a connected host computer, and generates image data representing an image to be printed on paper. The generated image data are developed in an image memory of the printer. Upon a printer engine in the printer receives the developed image data, the printer engine forms the image on the paper. In this specification, the image data included in the print data supplied by the host computer to the printer is referred to as xe2x80x9cprint dataxe2x80x9d, and image data to be output to the printer engine is referred to as xe2x80x9cimage dataxe2x80x9d.
In such the printer, the image data previously developed in the image memory are compressed, and then the image memory is refreshed with the compressed data, if the free area in the image memory is too small to accept newly arrived print data. After preparing sufficient free area, image data are generated based on received print data, and the generated image data are developed in the prepared free area. Or, the generated image data are stored in the free area after compressing. The compressed image data in the image memory will be decompressed by a compressor/decompressor before supplied to the printer engine.
Such the compression/decompression processing is frequently carried out in the printer for canceling the capacity shortage of the image memory. Through the, processing, the highest priority is given to decompression of image data in the image memory to be output to the printer engine, in order to avoid delay in forming images on the paper. Under this condition, if several requests for compression/decompression processing are given, the compressor/decompressor is often occupied in decompressing the image data developed in the image memory.
The host computer usually supplies compressed print data to the printer. A CPU of the printer executes a program for decompressing such the compressed print data, in order to frequently supply the image data to the printer engine. In this structure, since the print data decompression requires relatively a long time period, process time of the printer as a whole is also elongated.
It is an object of the present invention to reduce process time for printing with efficient data compression/decompression in an image forming apparatus such as a printer.
To accomplish the above object, an image forming apparatus according to a first aspect of the present invention is an image forming apparatus having an image forming mechanism for forming an image represented by data supplied from a host device on a record medium, the image forming apparatus comprises:
a compressor/decompressor which compresses and decompresses data;
a buffer, connected to the compressor/decompressor by a signal line, which stores compressed original data given by a host device in order to generate image data;
an image memory, connected to the compressor/decompressor and the buffer by signal lines, which stores image data or compressed image data to be output;
a transfer circuit which outputs the image data or decompressed image data in the image memory via a first way formed by a signal line which connects the transfer circuit directly to the image memory or via a second way formed by a signal line which connects the transfer circuit to the image memory via the compressor/decompressor;
an image forming mechanism which forms an image corresponding to image data supplied by the transfer circuit on a record medium; and
a processor which executes a predetermined program to control data compression/decompression by the compressor/decompressor and data transfer among the compressor/decompressor, the buffer, the image memory, and the transfer circuit,
wherein the processor switches the compressor/decompressor to decompress the compressed image data in the image memory or to decompress the compressed original data in the buffer.
In the above image forming apparatus, the processor may discriminate whether a present period is a period for transferring the image data or the compressed image data in the image memory to the image forming mechanism via the transfer circuit, and may control the compressor/decompressor to decompress the original data in the buffer when the processor discriminates that the present period is not the period for transferring the image data or the compressed image data to the image forming mechanism.
In this case, the processor may execute a predetermined program to decompress the original data in the buffer when the processor discriminates that the present period is the period for transferring the image data or the compressed image data to the image forming mechanism.
According to the above described image forming apparatus, the original data supplied by the host device are decompressed by the hardware component (compressor/decompressor). This structure realizes reduction of process time for data compression/decompression, thus, process time for whole printing operation will be reduced.
In the above image forming apparatus, the processor may further control compression of uncompressed image data in the image memory.
In this case, the processor may discriminate whether a present period is a period for transferring the image data or compressed image data in the image memory to the image forming mechanism via the transfer circuit, and
may controls the compressor/decompressor to compress the uncompressed image data in the image memory when the processor discriminates that the present period is not the period for transferring the image data or the compressed image data to the image forming mechanism.
In the above image forming apparatus, the processor may control the compressor/decompressor to decompress the original data when the original data is supplied from the host device,
may detect whether time sequence for image forming based on the supplied print data reaches a predetermined timing, and
may control the compressor/decompressor to quit decompressing the original data when the processor detects that the time sequence reaches the predetermined timing.
In this case, the predetermined timing may appear, for example, before a timing where the record medium reaches a predetermined position by conveyance in the image forming which appears after a maximum time period required for decompressing the original data for 1 block lapses since the predetermined timing.
In the above image forming apparatus, the processor may control the compressor/decompressor to decompress the original data in the buffer when an image data set in next block is standing by for data transfer, even if the processor discriminates that the present period is the period for transferring the image data or the compressed image data to the image forming mechanism.
In this case, the size of block for the original data may be equal to the size of block for the image data.
Or, the processor may switch the compressor/decompressor to compress the image data after saving the data being processed by the compressor/decompressor when the image data become transferable while the original data is being decompressed, and
may switch the compressor/decompressor to decompress the print data again after restoring the saved data in the compressor/decompressor, when the image data transfer is resting or completed.
In the above image forming apparatus, the processor may control the compressor/decompressor to compress the uncompressed image data in the image memory when an image data set in next block is standing by for data transfer, even if the processor discriminates that the present period is the period for transferring the image data or the compressed image data to the image forming mechanism.
To accomplish the above object, a method according to a second aspect of the present invention is a method of controlling data compression/decompression in the above image forming apparatus, comprises:
discriminating whether a present period is a period for transferring the image data or the compressed image data in the image memory to the image forming mechanism via the transfer circuit; and
controlling the compressor/decompressor to decompress the original data in the buffer when it is discriminated that the present period is not the period for transferring the image data or the compressed image data to the image forming mechanism.
The method may further comprise executing a predetermined program to decompress the original data in the buffer when it is discriminated that the present period is the period for transferring the image data or the compressed image data to the image forming mechanism.
The method may further comprising controlling the compressor/decompressor to decompress the original data in the buffer when an image data set in next block is standing by for data transfer, even if it is discriminated that the present period is the period for transferring the image data or the compressed image data to the image forming mechanism.
To accomplish the above object, a method according to a third aspect of the present invention is a method of controlling the above compression/decompression of data, comprises:
discriminating whether a present period is a period for transferring the image data or compressed image data in the image memory to the image forming mechanism via the transfer circuit; and
controlling the compressor/decompressor to compress the uncompressed image data in the image memory when it is discriminated that the present period is not the period for transferring the image data or the compressed image data to the image forming mechanism.
To accomplish the above object, a method according to a fourth aspect of the present invention is a method of controlling the above compression/decompression of data, comprises:
controlling the compressor/decompressor to decompress the original data when the original data is supplied from the host device;
detecting whether time sequence for image forming based on the supplied print data reaches a predetermined timing; and
controlling the compressor/decompressor to quit decompressing the original data when the detecting detects that the time sequence reaches the predetermined timing.